<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/9/009
 * Time: 11:34
 */

namespace app\api\controller\v1;


use app\api\controller\BaseController;
use app\api\model\Article as ArticleModel;
use app\api\validate\IDMustBePostiveInt;

class Article extends BaseController {

    /**
     * 获取文章列表
     * @return \think\Paginator
     */
    public function articleList() {
        return ArticleModel::articleList();
    }

    /**
     * 获取文章详情
     * @param $id
     * @return array|null|\PDOStatement|string|\think\Model
     */
    public function articleInfo($id) {
        (new IDMustBePostiveInt())->goCheck();
        return ArticleModel::articleInfo($id);
    }
}